// Created by Joe on 2017/6/10.

app.directive(
    'focusHelper',
    function () {
        return {
            restrict: 'A',
            link: function (scope, ele, attr) {
                var id = attr.id;

                scope.$watch(attr.focusId, function (val) {
                    if (val == id) {
                        document.getElementById(val).focus();
                    }
                });
            }
        };
    }
);